# -*- coding: utf8-*-
_author_ = 'yykrlc'
#import logging
#logging.basicConfig(filename='weixin.log', level=logging.WARNING)
from flask import Flask, request
from app.werobot import WeRoBot
#from celery import Celery
from flask_sqlalchemy import SQLAlchemy
from app_config import ProductionConfig, BaseConfig
#from flask_socketio import SocketIO


# --------------------

app = Flask(__name__)
db = SQLAlchemy()
#socketio = SocketIO()
#celery = Celery(__name__, broker=BaseConfig.CELERY_BROKER_URL)


def create_app(config_name=ProductionConfig):
    app.config.from_object(config_name)
    db.init_app(app)
    #socketio.init_app(app)
    from wxgzh import weixin as weixin_blueprint
    #from api import api as api_blueprint
    #app.register_blueprint(api_blueprint, url_prefix='/api')
    app.register_blueprint(weixin_blueprint, url_prefix='/weixin')
    return app


@app.route('/')
def index():
    print '----soket----',request.values
    return 'ed290ad6313c00974d43b71328fa76ac'
